GUI problem

My Gui is almost complete, but while doing some tests, i got a problem.
I wanna the attribute applicability in the GUI to receive the option in the applicability attribute on the module.

The away its is, its work, but when i trigger the GUI in a object that is both options selected, the GUI only shows one. Like in the attached file.

after this the GUI start to work normally showing whats on the module.

This is normal?
Bruwbruw - Fri Mar 23 09:38:06 EDT 2012

Re: GUI problem
llandale - Fri Mar 23 11:41:20 EDT 2012

It would be better to post the DXL than provide a screen shot of it.
Not sure what's going on, but these are my impressions:
  • Do not increment "IQE++", the loop control variable, inside the loop. As you've coded it, iQE starts as zero, gets incremented to 1 at the bottom, and back at the top it gets incremented again. So the first loop it has value zero, the 2nd loop it has value 2, and it never loops with value 1. Insert "print "\tiQE loop = " iQE "\n" to see what I mean.
  • Code would be easier to read if you put "set(selectedChoiceQE, iQE)" inside the loop, before "break".
  • you don't need to refresh the module unless you change the module, this tends to put the selected object at the top.
  • your "set(selectedChoiceQA, attrAppliIndex)" doesn't look right. The "Applicability" DBE is surely a multi-list, in which case you need set(DBE list, int index, bool selected), setting index either true or false depending on "isMember". false is important to reset the previous object's value.
  • Get a handle on the "current Module" when the script starts, and use that handle instead of "current Module" throughout. The "current Module" can change while the script is running.
    • Module mCurr = current
    • ...
    • AttrDef ad = find(mCurr, aName)
  • I doubt it, but perhaps you need to call "updateVariables" after you "realize" the dialog but before you "show"
it.

-Louie

Re: GUI problem
Bruwbruw - Fri Mar 23 12:50:08 EDT 2012

there's my code.
Attachments

attachment_14804564_L450_Requirements_Checklist.dxl

Re: GUI problem
llandale - Fri Mar 23 14:03:20 EDT 2012

Bruwbruw - Fri Mar 23 12:50:08 EDT 2012
there's my code.

These changes solved your immediate problem:

Comparing files C:\DOORS-STUFF\DXL-LOCAL\CURR-DXL\L450_Requirements_Checklist.dxl and C:\DOORS-STUFF\DXL-LOCAL\CURR-DXL\L450_REQUIREMENTS_CHECKLIST_MODIFIED.DXL
***** C:\DOORS-STUFF\DXL-LOCAL\CURR-DXL\L450_Requirements_Checklist.dxl
  103:      for(attrAppliIndex=0; attrAppliIndex<answerType3.size; attrAppliIndex=attrAppliIndex+1) {
  104:                  if(isMember(obj."Applicability", answerType3.strings[attrAppliIndex])) {
  105:                                  set(selectChoiceQA, attrAppliIndex)
  106:                          } 
  107:                  }
***** C:\DOORS-STUFF\DXL-LOCAL\CURR-DXL\L450_REQUIREMENTS_CHECKLIST_MODIFIED.DXL
  103:          for(attrAppliIndex=0; attrAppliIndex<answerType3.size; attrAppliIndex=attrAppliIndex+1) {
  104:                  set(selectChoiceQA, attrAppliIndex, isMember(obj."Applicability", answerType3.strings[attrAppliIndex]))
  105:                  }
*****
 
***** C:\DOORS-STUFF\DXL-LOCAL\CURR-DXL\L450_Requirements_Checklist.dxl
  296:  1, 13,false)
  299:          updateVariables()
***** C:\DOORS-STUFF\DXL-LOCAL\CURR-DXL\L450_REQUIREMENTS_CHECKLIST_MODIFIED.DXL
  294:  1, 13,false)
  296:          realize verEvidenceBox
  297:          updateVariables()
*****


The first change sets the dialog values either true or false; previously http://] if L450 was already selected it would remain selected when you went to the next object.[ setting erased the previous setting.
The 1st change requires the dialog be "realized" (take its form) before you set/reset. I don't recall all the rules about DBEs and "realize", but dealing with "lists" frequently requires it.

Also..

 

  • Not sure your "wasModified" code is right. Perhaps replace the "wasModified" code with "if (unsaved(obj))" to cover the times no change was actually made.
  • Your nesting gave me vertigo. Good thing Crimson Editor has matching bracked highlighting.
  • Tend to define your attribute names as string constants up front.
  • you can replace your "uName" stuff with just "doorsname".


-Louie

 

Re: GUI problem
Bruwbruw - Mon Mar 26 06:51:21 EDT 2012

Thanks for your help. It's working now.
Sorry for the vertigo.

Re: GUI problem
JesLewis - Thu Mar 29 08:08:54 EDT 2012

It looks like im trying to so something similar and im new to dxl, can you show me how you looped through the module object by object using a next/previous and displayed the tag, text and ability for the user to put a choice for a given attribute? I can write a loop I just dont know how to get it to display the relevant columns in the gui